import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import cesium from 'vite-plugin-cesium'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
const path = require('path')

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), cesium(),
    AutoImport({
      resolvers: [ElementPlusResolver()],
    }),
    Components({
      resolvers: [ElementPlusResolver()],
    })
  ],
  base: './',
  server: {
    port: 8611
  },
  resolve: {
    alias: {
      '@': path.join(__dirname, 'src/render'),
      "@components": path.resolve(__dirname, 'src/render/components'),
      "@hooks": path.resolve(__dirname, 'src/render/hooks'),
      "@assets": path.resolve(__dirname, "src/render/assets"),
      "@types": path.resolve(__dirname, 'src/render/types'),
      "@config": path.resolve(__dirname, 'src/render/config'),
      "@views": path.resolve(__dirname, 'src/render/views'),
      "@utils": path.resolve(__dirname, 'src/render/utils'),
      "@workers": path.resolve(__dirname, 'src/render/workers'),
      "@entity": path.resolve(__dirname, 'src/render/entity')
    }
  }
})
